package cn.explink.dop.entity.vo;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.GenericGenerator;

import cn.explink.distributor.framework.AbstractOrder;
import cn.explink.dop.enums.OrderPayMethodEnum;
import cn.explink.dop.enums.OrderStatusEnum;
import cn.explink.dop.tools.Tools;


public class TempOrderVO  {
	/**
	 *
	 */

	private String id;
	
	private String deliverFee;
	
	

	public String getDeliverFee() {
		return deliverFee;
	}

	public void setDeliverFee(String deliverFee) {
		this.deliverFee = deliverFee;
	}

	/**
	 * 订单编码
	 */
	private String code;
	/**
	 * 订单名称
	 */
	private String orderNo;
	/**
	 * 订单状态
	 */
	private String status;

	/**
	 * 订单状态日志
	 */
	private String statusLog;
	/**
	 * 总价
	 */
	private String orderMoney;
	/**
	 * 订单明细
	 */
	private String detail;
	/**
	 * 客户名称
	 */
	private String custName;
	/**
	 * 客户电话
	 */
	private String telephone;
	/**
	 * 客户地址
	 */
	private String custAddress;
	/**
	 * 配送备注
	 */
	private String note;
	/**
	 * 配送时间
	 */
	private java.util.Date deliveryTime;
	/**
	 * 支付方式
	 */
	private int payMethod;

	/**
	 * 是否需要保温
	 */
	private int needWarmBox;

	/** 创建时间 */
	private java.util.Date createDate;
	/** 创建人ID */
	private java.lang.String createBy;
	/** 创建人名称 */
	private java.lang.String createName;
	/** 修改时间 */

	private java.util.Date updateDate;
	/** 修改人ID */

	private java.lang.String updateBy;
	/** 修改人名称 */

	private java.lang.String updateName;

	/**
	 * 店面
	 */
	private StorefrontVO storefrontEntity;

	/**
	 * 分配到的配送员
	 */
	private DeliveryManVO deliveryMan;

	/**
	 * 拒绝过这单的配送员ID列表中间用,隔开
	 */
	private String refuseDeliveryman;

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID", nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}


	public String getStatus() {
		return this.status;
	}
	
	public void setStatus(String ss) {
		 this.status=ss;
	}


	@Column(name = "status_log")
	public String getStatusLog() {
		return this.statusLog;
	}

	public void setStatusLog(String statusLog) {
		this.statusLog = statusLog;
	}


	public String getDetail() {
		return this.detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	@Column(name = "cust_name")
	public String getCustName() {
		return this.custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}

	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "cust_address")
	public String getCustAddress() {
		return this.custAddress;
	}

	public void setCustAddress(String custAddress) {
		this.custAddress = custAddress;
	}

	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name = "delivery_time")
	public java.util.Date getDeliveryTime() {
		return this.deliveryTime;
	}
	
	public String getCrateTimeStr() {
		return Tools.formatTime(getDeliveryTime(), "yyyy-MM-dd");
	}

	public void setDeliveryTime(java.util.Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	@Column(name = "pay_method")
	public int getPayMethod() {
		return this.payMethod;
	}

	// 用于支付方式的显示
	@Transient
	public String getPayMethodText() {
		return OrderPayMethodEnum.getTextByValue(this.payMethod);
	}

	public void setPayMethod(int payMethod) {
		this.payMethod = payMethod;
	}

	@Column(name = "need_warm_box")
	public int getNeedWarmBox() {
		return this.needWarmBox;
	}

	public void setNeedWarmBox(int needWarmBox) {
		this.needWarmBox = needWarmBox;
	}

	@Column(name = "create_date")
	public java.util.Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(java.util.Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "create_by")
	public java.lang.String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(java.lang.String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_name")
	public java.lang.String getCreateName() {
		return this.createName;
	}

	public void setCreateName(java.lang.String createName) {
		this.createName = createName;
	}

	@Column(name = "update_date")
	public java.util.Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(java.util.Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "update_by")
	public java.lang.String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(java.lang.String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_name")
	public java.lang.String getUpdateName() {
		return this.updateName;
	}

	public void setUpdateName(java.lang.String updateName) {
		this.updateName = updateName;
	}

	@JsonIgnore
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storefront_id")
	public StorefrontVO getStorefrontEntity() {
		return this.storefrontEntity;
	}

	@Transient
	public String getStorefrontName() {
		if (this.storefrontEntity != null) {
			return this.storefrontEntity.getStoName();
		} else {
			return "";
		}
	}

	public void setStorefrontEntity(StorefrontVO storefrontEntity) {
		this.storefrontEntity = storefrontEntity;
	}

	@JsonIgnore
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deliveryman_id")
	public DeliveryManVO getDeliveryMan() {
		return this.deliveryMan;
	}

	public void setDeliveryMan(DeliveryManVO deliveryMan) {
		this.deliveryMan = deliveryMan;
	}

	@Column(name = "refuse_deliveryman")
	public String getRefuseDeliveryman() {
		return this.refuseDeliveryman;
	}

	public void setRefuseDeliveryman(String refuseDeliveryman) {
		this.refuseDeliveryman = refuseDeliveryman;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getOrderMoney() {
		return orderMoney;
	}

	public void setOrderMoney(String orderMoney) {
		this.orderMoney = orderMoney;
	}


}
